# $Id: PKGBUILD 80207 2012-11-17 15:54:28Z jelle $
# Maintainer: Jaroslav Lichtblau <dragonlord@aur.archlinux.org>

pkgname=man-pages-de
pkgver=0.9
pkgrel=2
pkgdesc="German Linux man pages"
arch=('any')
url="https://alioth.debian.org/projects/manpages-de/"
license=('custom')
depends=('man-db')
changelog=$pkgname.changelog
options=('!emptydirs')
source=(http://manpages-de.alioth.debian.org/downloads/manpages-de-$pkgver.tar.bz2)
sha256sums=('c69ebb685150995e77f32ad0742cd23291d046ebb54d518ee8db06ab022a2d63')

package() {
  cd ${srcdir}/manpages-de-$pkgver

  install -D -m644 COPYRIGHT ${pkgdir}/usr/share/licenses/$pkgname/COPYRIGHT

  for i in 1 2 3 4 5 6 7 8;
      do install -d ${pkgdir}/usr/share/man/de/man$i;
  done;

  find man?/ -name '*.?' -exec iconv -f latin1 -t utf8 -o ${pkgdir}/usr/share/man/de/{} {} \;

  # Remove duplicate man page, it's owned by shadow
  rm generated/man1/groups.1
  # Install generated man pages
  cd generated
  find man?/ -name '*.?' -exec iconv -f latin1 -t utf8 -o ${pkgdir}/usr/share/man/de/{} {} \;

}
